<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>siglongjmp</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_000_008_654">&nbsp;</a>NAME</h4><blockquote>
siglongjmp - non-local goto with signal handling
</blockquote><h4><a name = "tag_000_008_655">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="setjmp.h.html">setjmp.h</a>&gt;

void siglongjmp(sigjmp_buf <i>env</i>, int <i>val</i>);
</code>
</pre>
</blockquote><h4><a name = "tag_000_008_656">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>siglongjmp()</i>
function restores the environment saved by the most recent invocation of
<i><a href="sigsetjmp.html">sigsetjmp()</a></i>
in the same thread, with the corresponding
<i>sigjmp_buf</i>
argument.  If there is no such invocation, or if the function containing the
invocation of
<i><a href="sigsetjmp.html">sigsetjmp()</a></i>
has terminated execution in the interim, the behaviour is undefined.
<p>
All accessible objects have values as of the time
<i><a href="sigsetjmp.html">sigsetjmp()</a></i>
was called, except that the values of objects of automatic
storage duration which are local to the function containing the
invocation of the corresponding
<i><a href="sigsetjmp.html">sigsetjmp()</a></i>
which do not have volatile-qualified type and which are
changed between the
<i><a href="sigsetjmp.html">sigsetjmp()</a></i>
invocation and
<i>siglongjmp()</i>
call are indeterminate.
<p>
As it bypasses the usual function call and return mechanisms,
<i>siglongjmp()</i>
will execute correctly in contexts of interrupts,
signals and any of their associated functions.
However, if
<i>siglongjmp()</i>
is invoked from a nested signal handler (that is, from a
function invoked as a result of a signal raised during the
handling of another signal), the behaviour is undefined.
<p>
The
<i>siglongjmp()</i>
function will restore the saved signal mask if and only if the
<i>env</i>
argument was initialised by a call to
<i><a href="sigsetjmp.html">sigsetjmp()</a></i>
with a non-zero
<i>savemask</i>
argument.
<p>
The effect of a call to
<i>siglongjmp()</i>
where initialisation of the
<b>jmp_buf</b>
structure was not performed in the calling thread is undefined.
</blockquote><h4><a name = "tag_000_008_657">&nbsp;</a>RETURN VALUE</h4><blockquote>
After
<i>siglongjmp()</i>
is completed, program execution continues as if the corresponding
invocation of
<i><a href="sigsetjmp.html">sigsetjmp()</a></i>
had just returned the value specified by
<i>val</i>.
The
<i>siglongjmp()</i>
function cannot cause
<i><a href="sigsetjmp.html">sigsetjmp()</a></i>
to return 0; if
<i>val</i>
is 0,
<i><a href="sigsetjmp.html">sigsetjmp()</a></i>
returns the value 1.
</blockquote><h4><a name = "tag_000_008_658">&nbsp;</a>ERRORS</h4><blockquote>
No errors are defined.
</blockquote><h4><a name = "tag_000_008_659">&nbsp;</a>EXAMPLES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_008_660">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
The distinction between
<i><a href="setjmp.html">setjmp()</a></i>
or
<i><a href="longjmp.html">longjmp()</a></i>
and
<i><a href="sigsetjmp.html">sigsetjmp()</a></i>
or
<i>siglongjmp()</i>
is only significant for programs which use
<i><a href="sigaction.html">sigaction()</a></i>,
<i><a href="sigprocmask.html">sigprocmask()</a></i>
or
<i><a href="sigsuspend.html">sigsuspend()</a></i>.
</blockquote><h4><a name = "tag_000_008_661">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_008_662">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="longjmp.html">longjmp()</a></i>,
<i><a href="setjmp.html">setjmp()</a></i>,
<i><a href="sigprocmask.html">sigprocmask()</a></i>,
<i><a href="sigsetjmp.html">sigsetjmp()</a></i>,
<i><a href="sigsuspend.html">sigsuspend()</a></i>,
<i><a href="setjmp.h.html">&lt;setjmp.h&gt;</a></i>.
<br>
</blockquote><h4>DERIVATION</h4><blockquote>
Derived from the ISO POSIX-1 standard.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>

